package com.qfedu.aunt.commons.controller;


import com.qfedu.aunt.commons.pojo.WorkType;
import com.qfedu.aunt.commons.result.R;
import com.qfedu.aunt.commons.service.WorkTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 工作类型表 前端控制器
 * </p>
 *
 * @author xiaobobo
 * @since 2022-10-26
 */
@RestController
@RequestMapping("/aunt/commons/workType")
@Api(description = "工作类型模块",tags = "工作类型模块")
public class WorkTypeController {

    @Autowired
    private WorkTypeService workTypeService;


    /**
     * 通过光做类型级别查询工作类型
     * @param level
     * @return
     */
    @ApiOperation(value = "通过类型id查询工作类型")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "level",value = "工作类型",dataType = "int",paramType = "path",required = true),
            @ApiImplicitParam(name = "token",value = "用户身份标识",dataType = "string",paramType = "header",required = true)
    })
    @GetMapping("/findWorkTypeByLevel/{level}")
    public R findWorkTypeByLevel(@PathVariable("level") Integer level) throws Exception{
        List<WorkType> workTypeList=workTypeService.findWorkTypeByLevel(level);
        return R.ok().setData("workTypeList",workTypeList);
    }




}

